package se.webbzon.boltzmann.object.geometry;

import se.webbzon.boltzmann.environment.AbstractEnvironment;
import se.webbzon.boltzmann.environment.EnvironmentInflator;
import se.webbzon.oschi01.worldeditor.WorldObjectDeflation;
import se.webbzon.oschi01.worldobject.WorldObject;
import se.webbzon.oschi01.worldobject.appearance.Appearance3DException;

public class GeometryInflator extends EnvironmentInflator {
	
	/*============================================================
	Constructors
	============================================================*/

	/** Creates a new GeometryInflator. **/
	public GeometryInflator(AbstractEnvironment env) {
		super(env,Geometry.worldObjectName);
	}
	
	/*============================================================
	Constructors
	============================================================*/

	@Override public WorldObject makeWorldObject(WorldObjectDeflation deflation) {
		try {
			return ((GeometryDeflation) deflation).makeGeometry();
		} catch (Appearance3DException e) {
			return null;
		}
	}

	@Override public GeometryDeflation makeDeflation(int deflationProperties, WorldObject[] dependencies) {
		return new GeometryDeflation(deflationProperties);
	}

}
